<?php
require_once '../config/common.php';
require_once '../config/config.php';
$col=$_REQUEST['col'];
$content=$_REQUEST['content'];
//$user=checksession();
$conn = new mysqli(HOST, USER, PASSWORD, DATABASE);
if ($conn->connect_errno) {
    throw new Exception('连接数据库失败' . $conn->connect_error);
}
$sql="update info_list set $col=? where id=1";
$stmt = $conn->prepare($sql);
$stmt->bind_param('s', $content);
$stmt->execute();
if ($stmt->errno) {
    echo "<script>alert('修改失败,点击返回');window.location='info.php'</script>";
} else {
    echo "<script>alert('修改成功,点击返回');window.location='info.php'</script>";
}

